package com.oa.admin.service;

import com.joneying.common.web.response.Resp;
import com.oa.admin.dto.KeyAddVO;
import com.oa.admin.dto.KeyUpdateVO;
import com.oa.admin.vo.KeysListVO;
import com.oa.core.PageResult;
import com.oa.admin.entity.Key;
import com.baomidou.mybatisplus.service.IService;
import com.oa.core.exception.BusinessException;
import com.oa.core.exception.DataIsEmptyException;

/**
 * <p>
 * 钥匙表 服务类
 * </p>
 *
 * @author syb123
 * @since 2019-01-22
 */
public interface IKeyService extends IService<Key> {
    /**
     * 自定义分页
     *
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageResult<Key> findList(Integer pageNum, Integer pageSize);

    /**
     * 根据id查询
     */
    Key findKeyById(String id);


    /**
     * 添加钥匙
     *
     * @param keyAddVO
     * @return
     */
    Resp addKeys(KeyAddVO keyAddVO) throws BusinessException;

    /**
     * 根据id修改钥匙
     *
     * @param keyUpdateVO
     * @return
     */
    Resp updateKeys(KeyUpdateVO keyUpdateVO) throws BusinessException;

    /**
     * 查询钥匙列表
     *
     * @param page
     * @param limit
     * @return
     */
    PageResult<KeysListVO> findKeysList(Integer page, Integer limit) throws DataIsEmptyException;

    /**
     * 根据主键id查询钥匙详情
     *
     * @param id
     * @return
     */
    Resp findKeysDetailsById(String id) throws DataIsEmptyException;

    boolean deleteKey(String id);
}
